package uk.org.landeg.euler.problems;

import java.util.Arrays;

import uk.org.landeg.euler.problems.framework.AbstractProblem;
import uk.org.landeg.euler.problems.framework.ProblemLauncher;
import uk.org.landeg.euler.problems.lib.CombinationGenerator;

public class Problem024 extends AbstractProblem {
	public static void main(String[] args) {
		ProblemLauncher launcher = new ProblemLauncher(new Problem024());
		launcher.solve();
	}

	@Override
	public Object solve() {
		CombinationGenerator gen = new CombinationGenerator(new int[]{0,1,2,3,4,5,6,7,8,9});
		System.out.println(Arrays.toString(gen.getCombination(1000000-1)));
		return CombinationGenerator.toLong(gen.getCombination(1000000-1));
	}

	@Override
	public String getDescription() {
		// TODO Auto-generated method stub
		return "What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?";
	}

	@Override
	public Integer getProblemNumber() {
		// TODO Auto-generated method stub
		return 24;
	}

}
